﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage/MasterPage.master" AutoEventWireup="true" culture="auto" meta:resourcekey="PageResource1" uiculture="auto"
    CodeFile="ClientContacter.aspx.cs" Inherits="SystemManage_ClientContacter" Title="客房联系人列表" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <div class="title">
                <asp:Label ID="lblCustomer" runat="server" Text="客户" meta:resourcekey="lblCustomerResource1"></asp:Label>
                <asp:Label ID="lblCustomerName"
                    runat="server" meta:resourcekey="lblCustomerNameResource1"></asp:Label><asp:Label ID="lblTitle" runat="server" Text="的联系人列表" meta:resourcekey="lblTitleResource1"></asp:Label></div>
            <table class="add_table" cellspacing="1" cellpadding="3" >
                <tr>  
                <td align="right"><asp:Label ID="lblContacter" runat="server" Text="联系人姓名：" meta:resourcekey="lblContacterResource1"></asp:Label></td>                
                    <td align="left">
                        <asp:TextBox ID="txtName" runat="server" meta:resourcekey="txtNameResource1"></asp:TextBox>&nbsp;&nbsp;<asp:Button 
                            ID="btnSearch" runat="server" CssClass="btn" Text="搜索" 
                            OnClick="btnSearch_Click" meta:resourcekey="btnSearchResource1" />

                    </td>                   
                </tr>              
            </table>
            <div id="divEntrust" runat="server">
                <div class="list_title">
                    <div class="autoleft">
                        &nbsp;<asp:Label ID="lblTotal" runat="server" 
                            meta:resourcekey="lblTotalResource1"></asp:Label>
                        <asp:Label ID="lblRecordFound" runat="server" Text="条记录" meta:resourcekey="lblRecordFoundResource1"></asp:Label></div>
                    <div class="autoright">
                        <asp:Label ID="lblPerPageDisplay" runat="server" Text="每页显示：" meta:resourcekey="lblPerPageDisplayResource1"></asp:Label>
                        <asp:DropDownList ID="ddlPages" runat="server" AutoPostBack="True" 
                            OnSelectedIndexChanged="ddlPages_SelectedIndexChanged" 
                            meta:resourcekey="ddlPagesResource1">
                            <asp:ListItem Selected="True" Text="3" Value="3" 
                                meta:resourcekey="ListItemResource1"></asp:ListItem>
                            <asp:ListItem Text="5" Value="5" meta:resourcekey="ListItemResource2"></asp:ListItem>
                        </asp:DropDownList>
                    </div>
                </div>
                <asp:GridView ID="gvClientList" runat="server" AllowPaging="True" PageSize="3" AutoGenerateColumns="False"
                    Width="100%" AllowSorting="True" OnPageIndexChanging="gvClientList_PageIndexChanging"
                    OnRowCommand="gvClientList_RowCommand" OnSorting="gvClientList_Sorting" 
                    OnRowDataBound="gvClientList_RowDataBound" 
                    meta:resourcekey="gvClientListResource1">
                    <PagerSettings Mode="NumericFirstLast" />
                    <PagerTemplate>
                        <table style="width: 100%">
                            <tr>
                                <td>
                                    <asp:Label ID="lblCurrentPage" runat="server" Text="页次" meta:resourcekey="lblCurrentPageResource1"></asp:Label>:&nbsp;<asp:Label
                                        ID="Label1" runat="server" Text='<%# ((GridView)Container.Parent.Parent).PageIndex+1      %>'></asp:Label>/<asp:Label
                                            ID="Label2" runat="server" Text='<%# ((GridView)Container.Parent.Parent).PageCount %>'></asp:Label>&nbsp;
                                    <asp:Label ID="lblTotalPages" runat="server" Text="总计" meta:resourcekey="lblTotalPagesResource1"></asp:Label>:&nbsp;<asp:Label
                                        ID="Label3" runat="server" Text="<%# ((System.Data.DataView)gvClientList.DataSource).Count %>"></asp:Label>
                                </td>
                                <td align="right">
                                    <asp:LinkButton ID="LinkButton1" runat="server" CommandName="Page" CommandArgument="First"
                                        Enabled="<%# ((GridView)Container.Parent.Parent).PageIndex!=0 %>" Text="首页"></asp:LinkButton>
                                    <asp:LinkButton ID="LinkButton2" runat="server" CommandArgument="Prev" CommandName="Page"
                                        Enabled="<%# ((GridView)Container.Parent.Parent).PageIndex!=0 %>" Text="前页"></asp:LinkButton>
                                    <asp:LinkButton ID="LinkButton3" runat="server" CommandName="Page" CommandArgument="Next"
                                        Enabled="<%# ((GridView)Container.Parent.Parent).PageIndex!=((GridView)Container.Parent.Parent).PageCount-1 %>"
                                        Text="后页"></asp:LinkButton>
                                    <asp:LinkButton ID="LinkButton4" runat="server" CommandArgument="Last" CommandName="Page"
                                        Enabled="<%# ((GridView)Container.Parent.Parent).PageIndex!=((GridView)Container.Parent.Parent).PageCount-1 %>"
                                        Text="尾页"></asp:LinkButton>&nbsp;
                                    <asp:Label ID="lblTurnOn" runat="server" Text="转第" meta:resourcekey="lblTurnTo"></asp:Label><asp:TextBox ID="txtPages"
                                        runat="server" Width="35px"></asp:TextBox>
                                    <asp:Label ID="lblPages2" runat="server" Text="页" meta:resourcekey="lblPages2Resource1"></asp:Label>
                                    <asp:LinkButton ID="lbtnGo" runat="server" Text="提交" OnClick="lbtnGo_Click"></asp:LinkButton>
                                </td>
                            </tr>
                        </table>
                    </PagerTemplate>
                    <Columns>
                        <asp:TemplateField HeaderText="姓名" SortExpression="LinkMan" 
                            meta:resourcekey="TemplateFieldResource1">
                            <ItemTemplate>
                                <asp:Label ID="lblLinkName" runat="server" Text='<%# Eval("LinkMan") %>' 
                                    ToolTip='<%# Eval("LinkMan") %>'></asp:Label>
                            </ItemTemplate>
                            <ItemStyle Width="10%" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="办公电话" SortExpression="TelNo" 
                            meta:resourcekey="TemplateFieldResource2">
                            <ItemTemplate>
                                <asp:Label ID="lblTelNo" runat="server" Text='<%# Eval("TelNo") %>' 
                                    ToolTip='<%# Eval("TelNo") %>'></asp:Label>
                            </ItemTemplate>
                            <ItemStyle Width="12%" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="移动电话" SortExpression="MPhone" 
                            meta:resourcekey="TemplateFieldResource3">
                            <ItemTemplate>
                                <asp:Label ID="lblPhone" runat="server" Text='<%# Eval("MPhone") %>' 
                                    ToolTip='<%# Eval("MPhone") %>' ></asp:Label>
                            </ItemTemplate>
                              <ItemStyle Width="12%" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="传真" SortExpression="Fax" 
                            meta:resourcekey="TemplateFieldResource4">
                            <ItemTemplate>
                                <asp:Label ID="lblFax" runat="server" Text='<%# Eval("Fax") %>' 
                                    ToolTip='<%# Eval("Fax") %>' ></asp:Label>
                            </ItemTemplate>
                              <ItemStyle Width="12%" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="电子信箱" SortExpression="Email" 
                            meta:resourcekey="TemplateFieldResource5">
                            <ItemTemplate>
                                <asp:Label ID="lblEmail" runat="server" Text='<%# Eval("Email") %>' 
                                    ToolTip='<%# Eval("Email") %>'></asp:Label>
                            </ItemTemplate>
                              <ItemStyle Width="14%" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="职位" SortExpression="Position" 
                            meta:resourcekey="TemplateFieldResource6">
                            <ItemTemplate>
                                <asp:Label ID="lblPosition" runat="server" Text='<%# Eval("Position") %>' 
                                    ToolTip='<%# Eval("Position") %>'></asp:Label>
                            </ItemTemplate>
                              <ItemStyle Width="10%" />
                        </asp:TemplateField>
                         <asp:TemplateField HeaderText="备注" SortExpression="Remark" 
                            meta:resourcekey="TemplateFieldResource7">
                            <ItemTemplate>
                                <asp:Label ID="lblReMark" runat="server" Text='<%# Eval("Remark") %>' 
                                    ToolTip='<%# Eval("Remark") %>'></asp:Label>
                            </ItemTemplate>
                            <ItemStyle Width="20%" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="操作" meta:resourcekey="TemplateFieldResource8">
                            <ItemTemplate>
                                  <asp:LinkButton ID="lbtnEdit" runat="server" Text="修改" CommandName="Ud" 
                                    CommandArgument='<%# Eval("PKID") %>' meta:resourcekey="lbtnEditResource1"></asp:LinkButton>
                                <asp:LinkButton ID="lbtnDel" runat="server" Text="删除" CommandArgument='<%# Eval("PKID") %>'
                                    OnClientClick="javascript:return confirm('确定要删除该客户联系人？');" 
                                    CommandName="Del" meta:resourcekey="lbtnDelResource1"></asp:LinkButton>
                            </ItemTemplate>
                            <ItemStyle Width="10%" />
                        </asp:TemplateField>
                    </Columns>
                    <HeaderStyle HorizontalAlign="Center" />
                    <RowStyle HorizontalAlign="Center" />
                </asp:GridView>

            </div>
            <br />
            <br />
            <div>
                <div class="title">
                    &nbsp;<asp:Label ID="lblPageType" runat="server" Text="编辑客户联系人" meta:resourcekey="lblPageTypeResource1"></asp:Label></div>
                <table class="add_table" cellspacing="1" cellpadding="3" align="center">
                    <tr>
                        <td align="right">
                            <label for="username">
                                <b style="color: Red">*</b></label><asp:Label ID="lblLinkMan" runat="server" Text="姓名：" meta:resourcekey="lblLinkManResource1"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtLinkMan" runat="server" Width="172px" 
                                ValidationGroup="linkman" meta:resourcekey="txtLinkManResource1"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="rqvalCode" runat="server" ControlToValidate="txtLinkMan" meta:resourcekey="rqvalCodeResource1"
                                ErrorMessage="名称不能为空" ValidationGroup="model"></asp:RequiredFieldValidator>
                        </td>
                        <td align="right">
                           <asp:Label ID="lblModel" runat="server" Text="办公电话：" meta:resourcekey="lblModelResource1"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtPhone" runat="server" Width="172px" 
                                meta:resourcekey="txtPhoneResource1"></asp:TextBox>
                        </td>
                    </tr>                  
                    <tr>
                        <td align="right">
                            <asp:Label ID="lblMobile" runat="server" Text="移动电话：" meta:resourcekey="lblMobileResource1"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtMobile" runat="server" 
                                meta:resourcekey="txtMobileResource1"></asp:TextBox>
                        </td>
                        <td align="right">
                            <asp:Label ID="lblFax" runat="server" Text="传真：" meta:resourcekey="lblFaxResource1"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtFax" runat="server" meta:resourcekey="txtFaxResource1"></asp:TextBox>
                        </td>
                    </tr>
                   
                    <tr>
                        <td align="right">
                            <asp:Label ID="lblEmail" runat="server" Text="电子信箱：" meta:resourcekey="lblEmailResource1"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtEmail" runat="server" meta:resourcekey="txtEmailResource1"></asp:TextBox>
                        </td>
                         <td align="right">
                            <asp:Label ID="lblPosition" runat="server" Text="职位：" meta:resourcekey="lblPositionResource1"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtPosition" runat="server" 
                                meta:resourcekey="txtPositionResource1"></asp:TextBox>
                        </td>
                    </tr>                    
                    <tr>
                        <td align="right">
                            <asp:Label ID="lblAddr" runat="server" Text="地址：" meta:resourcekey="lblAddrResource1"></asp:Label>
                        </td>
                        <td colspan="3">
                           <asp:TextBox ID="txtAddr" runat="server" Width="100%" 
                                meta:resourcekey="txtAddrResource1"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <asp:Label ID="lblRemark" runat="server" Text="备注：" meta:resourcekey="lblRemarkResource1"></asp:Label>
                        </td>
                        <td  colspan="3">
                           <asp:TextBox ID="txtRemark" runat="server" Width="100%" 
                                meta:resourcekey="txtRemarkResource1"></asp:TextBox>
                        </td>
                    </tr>
                </table>
                <table class="add_table" cellspacing="1" cellpadding="3">
                    <tr>
                        <td align="center">
                            <asp:Button ID="btnSave" runat="server" Text="保存" OnClick="btnSave_Click" CssClass="btn"
                                ValidationGroup="model" meta:resourcekey="btnSaveResource1" />
                            &nbsp;
                            <asp:Button ID="btnReset" runat="server" Text="返回" class="adminbtn" CssClass="btn"
                                OnClick="btnReset_Click" meta:resourcekey="btnResetResource1" />
                        </td>
                    </tr>
                </table>
                  <asp:Label  ID="hidPKID" runat="server" Visible="False" 
                    meta:resourcekey="hidPKIDResource1" />

            </div>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btnSearch" EventName="Click" />
        </Triggers>
    </asp:UpdatePanel>
</asp:Content>
